package com.template.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.template.mapper.UserMapper;
import com.template.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;



@Service
public class UserService extends ServiceImpl<UserMapper, User> {

    @Autowired
    private UserMapper userMapper;

    public IPage<User> selectUserPage(Page<User> page, Wrapper wrapper) {
        if (page == null) {
            page = new Page<>(1, Integer.MAX_VALUE);
        }
        return page.setRecords(userMapper.selectUserPage(page, wrapper));
    }
}
